
const AsyncMysqljs = require('../mysql/index')
const Query = AsyncMysqljs().query
const Get = AsyncMysqljs().get

module.exports = async (ctx, next) => {
    const {id} = ctx.request.query
    try {
        const film = await Get('SELECT * FROM film WHERE id=?', [id])
        ctx.body = {
            code: 1,
            data: film,
            msg: 'ok'
        }
    } catch (error) {
        console.log(error);
        
        ctx.body = {
            code: 1,
            data: {},
            msg: '后台服务发生错误！'
        }
    }
    
    
    
}